{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c40a6f59",
   "metadata": {},
   "outputs": [],
   "source": [
    "import jieba.posseg as pos  # jieba中文词性标注\n",
    "\n",
    "zh_content = \"我爱北京天安门\"\n",
    "\n",
    "zh_result = pos.lcut(zh_content)\n",
    "zh_result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5e079509",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hanlp  # hanlp中文词性标注\n",
    "\n",
    "tagger = hanlp.load(hanlp.pretrained.pos.CTB5_POS_RNN_FASTTEXT_ZH)\n",
    "\n",
    "eng_result = tagger(['我', '的', '希望', '是', '希望', '和平'])\n",
    "eng_result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cc8bea3c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hanlp\n",
    "\n",
    "eng_tagger = hanlp.load(hanlp.pretrained.pos.PTB_POS_RNN_FASTTEXT_EN)\n",
    "\n",
    "content = 'I banked 2 dollars in a bank .'\n",
    "\n",
    "eng_result = eng_tagger(list(content.split()))\n",
    "\n",
    "eng_result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bd99b9be",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "torchX",
   "language": "python",
   "name": "torchx"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
